Properly validate JS->native method calls#23658
Properly validate JS->native method calls#23658aleclarson wants to merge 1 commit intofacebook:masterfrom
Conversation
…id bridge Summary: A bunch of flows including JS reload and e2e tests seem to hit the race condition, causing redbox. For now, make it a warning to unblock. Differential Revision: D9327418 fbshipit-source-id: a72b378d88f7566268fd9415fbd34225c8b931e7
|
I've removed the warning entirely, in favor of silently ignoring method calls with no method queue. The |
|
I would prefer to have a warning, even just in dev mode. We’ve seen things like this happen when there’s memory corruption issues within JSC or CxxReact. Being able to catch the first symptoms earlier so a dump can be created and analyzed would help. |
Between invalidating a bridge and suspending its JS thread, native modules may have their methods called. Only warn when a native module has been invalidated, which happens right before its JS thread is suspended. Avoid initializing a native module's instance if its bridge is invalidated.
|
@matthargett Okay, fixed. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@fkgozali has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
This pull request was successfully merged by @aleclarson in dc89375. When will my fix make it into a release? | Upcoming Releases |
Summary: Between invalidating a bridge and suspending its JS thread, native modules may have their methods called. Only warn when a native module has been invalidated, which happens right before its JS thread is suspended. Avoid initializing a native module's instance if its bridge is invalidated. /cc fkgozali facebook@f945212#commitcomment-32467567 [iOS] [Fixed] - Properly validate JS->native method calls Pull Request resolved: facebook#23658 Differential Revision: D14287594 Pulled By: fkgozali fbshipit-source-id: 89dd1906a0c55f3f48ba4ff220aac0cddf2eb822 # Conflicts: # React/CxxModule/RCTNativeModule.mm
Summary
Between invalidating a bridge and suspending its JS thread, native modules may have their methods called.
Only warn when a native module has been invalidated, which happens right before its JS thread is suspended.
Avoid initializing a native module's instance if its bridge is invalidated.
/cc @fkgozali f945212#commitcomment-32467567
Changelog
[iOS] [Fixed] - Properly validate JS->native method calls
Test Plan
N/A